package org.example.mapper;

import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;
import org.example.pojo.OutboundOrder;
import org.example.pojo.OutboundOrderVo;

@Mapper
public interface OutboundOrderMapper {
    /**
     * 插入一条出库单
     * @param outBoundOrder
     */
    void insert(OutboundOrder outBoundOrder);

    /**
     * 根据订单号查询出库单
     * @param orderId
     * @return
     */
    Page<OutboundOrderVo> list(String orderId, Integer orderType, String startTime, String endTime);

    /**
     * 根据订单号查询出库单
     * @param orderId
     * @return
     */
    OutboundOrderVo getById(String orderId);

    /**
     * 更新出库单
     */
    @Update("update outbound_order set status = #{status} where order_id = #{orderId}")
    void update(OutboundOrder build);

    /**
     * 根据订单号删除出库单
     * @param orderId
     */
    @Delete("delete from outbound_order where order_id = #{orderId}")
    void delete(String orderId);
}
